package com.huwaiwai.aqs.park;

import java.util.concurrent.locks.LockSupport;

/**
 * Created by hww on 2018/6/5 下午5:13.
 */
public class TestParkAndInterrupted {

    public static void main(String [] args) {
        ParkAndInterrupted r = new ParkAndInterrupted();
        r.start();
        for (; ; ) {
            try {
                Thread.sleep(500L);
                System.out.println("主线程醒来,准备唤醒子线程");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            LockSupport.unpark(r);
        }
    }


}
